<div class="panel-body">
    <div class="table-responsive">
        <div class="dataTables_wrapper form-inline" id="dataTables-example_wrapper" role="grid">
            <div class="row" style="padding-bottom: 15px">
                <div class="col-sm-6">
                    <!--<div class="dataTables_length" id="dataTables-example_length">-->
                        <!--<select name="dataTables-example_length" class="form-control input-sm"-->
                                <!--aria-controls="dataTables-example">-->
                            <!--<option value="">区/县</option>-->
                            <!--<option value="10">10</option>-->
                            <!--<option value="25">25</option>-->
                            <!--<option value="50">50</option>-->
                            <!--<option value="100">100</option>-->
                        <!--</select>-->
                        <!--<select name="dataTables-example_length" class="form-control input-sm"-->
                                <!--aria-controls="dataTables-example">-->
                            <!--<option value="">分局</option>-->
                            <!--<option value="10">10</option>-->
                            <!--<option value="25">25</option>-->
                            <!--<option value="50">50</option>-->
                            <!--<option value="100">100</option>-->
                        <!--</select>-->
                        <!--<select name="dataTables-example_length" class="form-control input-sm"-->
                                <!--aria-controls="dataTables-example">-->
                            <!--<option value="">网格</option>-->
                            <!--<option value="10">10</option>-->
                            <!--<option value="25">25</option>-->
                            <!--<option value="50">50</option>-->
                            <!--<option value="100">100</option>-->
                        <!--</select>-->
                        <!--<select name="dataTables-example_length" class="form-control input-sm"-->
                                <!--aria-controls="dataTables-example">-->
                            <!--<option value="">场景</option>-->
                            <!--<option value="10">10</option>-->
                            <!--<option value="25">25</option>-->
                            <!--<option value="50">50</option>-->
                            <!--<option value="100">100</option>-->
                        <!--</select>-->
                        <!--<a class="btn btn-serch"> <i class="fa fa-search"></i>  查  询</a>-->
                    <!--</div>-->
                </div>
                <!--<div class="col-sm-6">
                    <div class="dataTables_filter" id="dataTables-example_filter" style="float: right">
                        <a class="btn btn-success" onclick="AddShopUser()"><i class="fa fa-plus"></i> 新 增 </a>
                    </div>
                </div>-->
            </div>
            <table class="table table-striped table-bordered table-hover dataTable no-footer" id="dataTables-example"
                   aria-describedby="dataTables-example_info">
                <thead>
                <tr role="row">
                    <th tabindex="0" class="sorting_asc" aria-controls="dataTables-example"
                        style="text-align: center;width: 5%;"
                        rowspan="1" colspan="1">序号
                    </th>
                    <th tabindex="0" class="sorting" aria-controls="dataTables-example"
                        style="text-align: center;width: 20%;" rowspan="1"
                        colspan="1">IP
                    </th>
                    <th tabindex="0" class="sorting" aria-controls="dataTables-example"
                        style="text-align: center;width: 20%;" rowspan="1"
                        colspan="1">创建时间
                    </th>
                    <th tabindex="0" class="sorting" aria-controls="dataTables-example"
                        style="text-align: center;width:30%;" rowspan="1"
                        colspan="1">接口
                    </th>
                    <th tabindex="0" class="sorting" aria-controls="dataTables-example"
                        style="text-align: center;width: 15%;" rowspan="1"
                        colspan="1">操作类型
                    </th>
                    <th tabindex="0" class="sorting" aria-controls="dataTables-example"
                        style="text-align: center;width: 10%;" rowspan="1"
                        colspan="1">操作人
                    </th>
                </tr>
                </thead>
                <tbody id="Loglist">

                </tbody>
            </table>
            <div class="row">
                    <div id="page" style="float: right"></div>
            </div>
        </div>
    </div>

</div>
<script>
    $(function () {
        //加载数据
        getdata(1);
    });

    ////请求列表
    function getdata(page) {
        var json = {
            url: GLOBAL.URL + "/sys/log/list",
            type: 'get',
            data:{"page":page,"limit":15},
            successfn: function(data) {
                UpdateLogList(data.page.list);
                setPage(data.page.totalPage);
            },
            errorfn: function() {
                //ajaxUpdataTable();
                //$.ligerDialog.warn("系统繁忙，请稍候再试");
            }
        };
        ajaxdata(json);

    }
    ////加载列表数据
    function UpdateLogList(data) {
        var listStr="";
        if(data != null) {
            for(var i = 0; i < data.length; i++) {
                data[i].ip=data[i].ip==null?"":data[i].ip;
                data[i].createDate=data[i].createDate==null?"":data[i].createDate;
                data[i].method=data[i].method==null?"":data[i].method;
                data[i].operation=data[i].operation==null?"":data[i].operation;
                data[i].username=data[i].username==null?"":data[i].username;
                if((i+1) % 2 > 0) {
                    listStr += '<tr  class="gradeA odd">';
                    listStr += '<td style="text-align: center;">' + (i+1) + '</td>';
                    listStr += '<td style="text-align: center;">'+data[i].ip+'</td>';
                    listStr += '<td style="text-align: center;">'+data[i].createDate+'</td>';
                    listStr += '<td style="text-align: left;">'+data[i].method+'</td>';
                    listStr += '<td style="text-align: center;">'+data[i].operation+'</td>';
                    listStr += '<td style="text-align: center;">'+data[i].username+'</td>';
                    listStr += '</tr>';
                }
                else {
                    listStr += '<tr class="gradeA even">';
                    listStr += '<td style="text-align: center;">' + (i+1) + '</td>';
                    listStr += '<td style="text-align: center;">'+data[i].ip+'</td>';
                    listStr += '<td style="text-align: center;">'+data[i].createDate+'</td>';
                    listStr += '<td style="text-align: left;">'+data[i].method+'</td>';
                    listStr += '<td style="text-align: center;">'+data[i].operation+'</td>';
                    listStr += '<td style="text-align: center;">'+data[i].username+'</td>';
                    listStr += '</tr>';
                }
            }
        }
        $("#Loglist").html(listStr);
    }
</script>